import request from "@/services/request.ts";
export const categoryList = async ()=>{
    return request.get('/category')
}

export const categoryCreate = async (data:CategoryForm)=>{
    return request.post('/category',data)
}

export const categoryUpdate = async (id:number,data:CategoryForm)=>{
    return request.put(`/category/${id}`,data)
}
export const categoryBatchUpdate = async (id:number[],data:object)=>{
    const ids = id.join(',')
    return request.put('/category/batch_update',{ids,data})
}
export const categoryDelete = async (id:number)=>{
    return request.del(`/category/${id}`)
}

export const categoryBatchDelete = async (id:number[])=>{
    const ids = id.join(',')
    return request.del(`/category/batch_delete`,{ids})
}